<template>
  <customizeDialog
    :visible="visible"
    @update:visible="visible = $event"
    ref="dialog"
    :title="title"
    @cb="cb"
  >
    <shenheContent
      :data="data"
      :user="user"
      :dept="dept"
      :opinion="opinion"
      :status="status"
      :passKey="passKey"
      v-if="data.length !== 0"
    ></shenheContent>
  </customizeDialog>
</template>

<script>
import customizeDialog from './customizeDialog.vue'
import shenheContent from './shenheContent'
export default {
  name: 'shenheHistory',
  components: { customizeDialog, shenheContent },
  data() {
    return {
      visible: false
    }
  },
  props: {
    // 审核历史
    data: {
      type: Array,
      default: () => {
        return []
      }
    },
    // 审核用户字段名
    user: {
      type: String,
      default: 'checkUserName'
    },
    // 审核部门字段名
    dept: {
      type: String,
      default: 'departName'
    },
    // 审核意见字段名
    opinion: {
      type: String,
      default: 'checkOpinion'
    },
    // 审核状态字段名
    status: {
      type: String,
      default: 'checkStatus'
    },
    // 审核通过的字段值，默认为Number类型2
    // 可接收String和Number类型
    passKey: {
      type: [String, Number],
      default: 2
    },
    // 弹窗标题名
    title: {
      type: String,
      default: '审核记录'
    }
  },
  methods: {
    openDialog() {
      this.visible = true
    },
    cb() {
      console.log('点击确认,回调了')
    }
  },
  mounted() {
    console.log('this.data', this.data)
  }
}
</script>

<style></style>
